# _*_ coding : utf-8 _*_
# @Time : 2022/8/14 21:23
# @Author : Moonquake
# @File : 31.request_代理
# @Project : python
import requests

url = 'http://www.baidu.com/s?'

headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.81 Safari/537.36 Edg/104.0.1293.54'
}

data ={
    'wd':'ip'
}

proxy ={
    'http':'171.92.21.175:9000'
}
response = requests.get(url=url,params=data,headers=headers,proxies=proxy)
response.encoding = 'utf-8'
content = response.text
with open('daili.html','w',encoding='UTF-8')as fp:
    fp.write(content)